import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom'
import axios from 'axios'
import { message, ConfigProvider } from 'antd';
import { Provider } from 'react-redux'
import store from './redux/store'

// 由于 antd 组件的默认文案是英文，所以需要修改为中文
import 'moment/locale/zh-cn';
import locale from 'antd/lib/locale/zh_CN';

import 'antd/dist/antd.css';

// import { api } from './api/api'

import './index.css';

import App from './App';

message.config({
  duration: 1,// 持续时间
  maxCount: 3, // 最大显示数, 超过限制时，最早的消息会被自动关闭
  // top: 70,// 到页面顶部距离
});
React.Component.prototype.$message = message;
React.Component.prototype.baseUrl = axios.defaults.baseURL;

ReactDOM.render(
  <Provider store={store}>
    <Router>
      <ConfigProvider locale={locale}>
        <App />
      </ConfigProvider>
    </Router>
  </Provider>,
  document.getElementById('root')
);
